From 6e27226763aeebe5ee0df492b3ae6730f5cd6ab0 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 27 Jul 2005 09:24:51 +0000 Subject: [PATCH] Fix memory reservation in XenLinux. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c | 8 ++++++++ linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c index c025cc3d4c..2e8aa94670 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c @@ -748,8 +748,10 @@ static int __init smp_scan_config (unsigned long base, unsigned long length) || (mpf->mpf_specification == 4)) ) { smp_found_config = 1; +#ifndef CONFIG_XEN printk(KERN_INFO "found SMP MP-table at %08lx\n", virt_to_phys(mpf)); + reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE); if (mpf->mpf_physptr) { /* * We cannot access to MPC table to compute @@ -766,6 +768,10 @@ static int __init smp_scan_config (unsigned long base, unsigned long length) size = end - mpf->mpf_physptr; reserve_bootmem(mpf->mpf_physptr, size); } +#else + printk(KERN_INFO "found SMP MP-table at %08lx\n", + ((unsigned long)bp - (unsigned long)isa_bus_to_virt(base)) + base); +#endif mpf_found = mpf; return 1; @@ -809,9 +815,11 @@ void __init find_smp_config (void) * MP1.4 SPEC states to only scan first 1K of 4K EBDA. */ +#ifndef CONFIG_XEN address = get_bios_ebda(); if (address) smp_scan_config(address, 0x400); +#endif } /* -------------------------------------------------------------------------- diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c index 20d9fc467a..50e0cf52e1 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c @@ -1060,6 +1060,7 @@ static void __init register_bootmem_low_pages(unsigned long max_low_pfn) } } +#ifndef CONFIG_XEN /* * workaround for Dell systems that neglect to reserve EBDA */ @@ -1070,6 +1071,7 @@ static void __init reserve_ebda_region(void) if (addr) reserve_bootmem(addr, PAGE_SIZE); } +#endif #ifndef CONFIG_DISCONTIGMEM void __init setup_bootmem_allocator(void); @@ -1152,6 +1154,13 @@ void __init setup_bootmem_allocator(void) reserve_bootmem(HIGH_MEMORY, (PFN_PHYS(min_low_pfn) + bootmap_size + PAGE_SIZE-1) - (HIGH_MEMORY)); +#ifndef CONFIG_XEN + /* + * reserve physical page 0 - it's a special BIOS page on many boxes, + * enabling clean reboots, SMP operation, laptop functions. + */ + reserve_bootmem(0, PAGE_SIZE); + /* reserve EBDA region, it's a 4K region */ reserve_ebda_region(); @@ -1176,6 +1185,7 @@ void __init setup_bootmem_allocator(void) */ acpi_reserve_bootmem(); #endif +#endif /* !CONFIG_XEN */ #ifdef CONFIG_BLK_DEV_INITRD if (xen_start_info.mod_start) { -- 2.30.2